# 示例 2: 多个线程
import threading
import time

def print_numbers(thread_name):
    for i in range(5):
        time.sleep(1)
        print("{}:{}".format(thread_name, i))

# 创建并启动多个线程
threads = []
for i in range(3):
    thread = threading.Thread(target=print_numbers, args=("Thread-{}".format(i+1),))
    threads.append(thread)
    thread.start()

# 等待所有线程完成
for thread in threads:
    thread.join()

print("All threads have finished execution.")





















